"""
@author: Nasa
@time: 2022/7/31 18:13
冒泡排序
"""
from utils.array_utils import check_is_sorted


def bubbles(l):
    for j in range(len(l)):
        for i in range(len(l) - 1):
            if l[i] > l[i + 1]:
                l[i], l[i + 1] = l[i + 1], l[i]


if __name__ == '__main__':
    l = [5, 3, 6, 2, 5, 9, 8]
    bubbles(l)
    print(l)
    print(check_is_sorted(bubbles))